#!/bin/bash

# Basic until loop
# 传递用户名给脚本程序
# ./loop_until.sh root

until whoami | grep "$1" >/dev/null; do
    echo "waiting."
    sleep 10
done

echo -e '\a'
echo "*********** $1 has just logged in ************"

exit 0
